home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / et / et3_0-a1.lha / et3 / src / PROGENV / SrcBrowser.h < prev   
C/C++ Source or Header  |  1992-07-09  |  3KB  |  124 lines

  1. #ifndef SrcBrowser_First
  2. #ifdef __GNUG__
  3. //pragma once
  4. #pragma interface
  5. #endif
  6. #define SrcBrowser_First
  7.  
  8. #include "Document.h"
  9. #include "CodeTextView.h"
  10. #include "Mark.h"
  11.  
  12. class PeSrcBrowserTextView;
  13. class PeClassListView;
  14. class PeMethodBrowser;
  15. class PeImplementors;
  16. class Text;
  17. class OrdCollection;
  18. class Data;
  19. class PeMethodReference;
  20. class PrettyPrinter;
  21. class TextField;
  22.  
  23. //---- SourceBrowser ------------------------------------------------------------
  24.  
  25. class PeSourceBrowser: public Document {
  26.     static PeSourceBrowser *browser;
  27.     static int srcCount;
  28.  
  29.     VObject *classScroller;
  30.     VObject *methodScroller;
  31.     PeSrcBrowserTextView *textview;
  32.     PeClassListView *listview;
  33.     PeMethodBrowser *methods;
  34.     PeImplementors *implementors;
  35.     TextField *implTitle;
  36.     Text *text;
  37.     Class *ccl;
  38.     
  39.     bool isCCode, definition, base;
  40.     OrdCollection *log;
  41.  
  42.     char *FirstWordOfSelection();
  43. public:
  44.     MetaDef(PeSourceBrowser);
  45.     PeSourceBrowser(Manager *m);
  46.     ~PeSourceBrowser();
  47.  
  48.     VObject *DoMakeContent();
  49.     bool LoadData(Data *data, bool unique);
  50.     void SetWindowTitle(char *name);
  51.  
  52.     bool DoReadData(Data *data);
  53.     bool DoWrite(OStream &s, Data*);
  54.     bool CanImport(Data*);
  55.     Command *DoImport(Data*);
  56.     void CollectParts(Collection *col);
  57.  
  58.     void SetClass(Class*, bool decl, bool reveal= TRUE);
  59.     void DoSetClass(Class*, bool decl, bool unique, bool reveal);
  60.     void RevealMethod(PeMethodReference *mr);
  61.     void RevealAndSelectLine(int l);
  62.     void SelectSourceLine(bool redraw);
  63.     bool FileOfClass(Class *cl, char *fname, bool decl);
  64.     void SetMode(bool decl);
  65.     void Spawn();
  66.     Class *GetClass()
  67.     { return ccl; }
  68.     bool GetMode()
  69.     { return definition; }
  70.  
  71.     //---- menus
  72.     MenuBar *DoMakeMenuBar();
  73.     Command *DoMenuCommand(int cmd);
  74.     void DoSetupMenu(Menu *menu);
  75.     
  76.     void Control(int id, int part, void *val);
  77.     void InputKbd(Token &t);
  78.  
  79.     //--- commands
  80.     void Log(Class *cl);
  81.     void EditSelectedClass();
  82.     void ShowImplementors();
  83.     void InspectSomeInstance();
  84.  
  85.     static void ShowClass(Manager *m, Class *cp, bool decl, int at= -1);
  86.     static void Spawn(Manager *m, Class *cp, bool decl, int at= -1);
  87. };
  88.  
  89. //---- SrcBrowserTextView ---------------------------------------------------------
  90.  
  91. class PeSrcBrowserTextView: public CodeTextView {
  92. public:
  93.     MetaDef(PeSrcBrowserTextView);
  94.     PeSrcBrowserTextView(EvtHandler *eh, Rectangle r, Text *t);    
  95.  
  96.     PrettyPrinter *MakePrettyPrinter(Text *t, CharStyle *cs, CharStyle *fs,
  97.                           CharStyle *cds, CharStyle *ps);
  98.  
  99.     void ShowMethod(PeMethodReference *mr);
  100. };
  101.  
  102. class PeSrcBrowserPPrinter: public PrettyPrinter {
  103.     PeSrcBrowserTextView *tvp;
  104. public:
  105.     PeSrcBrowserPPrinter(PeSrcBrowserTextView *tvp, Text *t, 
  106.         CharStyle *cs, CharStyle *fs, CharStyle *cds, CharStyle *ps);
  107.     void Function(int line, int start, int end, char *name, char *classname);
  108. };
  109.  
  110. //---- PeMethodMark ---------------------------------------------------------
  111.  
  112. class PeMethodMark: public Mark {
  113. public:
  114.     char *className;
  115.     char *method;
  116.     
  117.     MetaDef(PeMethodMark);
  118.     PeMethodMark(char *classname, char *method, int p= 0, int l= 0);
  119.     ~PeMethodMark();
  120. };
  121.  
  122. #endif
  123.  
  124.